1. Field of the Invention
The invention relates to a block matching method, and more particularly, to a block matching method capable of correctly determining a motion vector by utilizing a mask area to filter out interference from other objects.
2. Description of the Prior Art
Motion estimation is an important technique used in video compression, its objective being to reduce redundant information from video frames at various time points. Generally, a video achieves an illusion of motion through playback of a series of still images differentiated by subtle variations between two consecutive frames, as a result of persistence of human vision. Moreover, images in two adjacent frames are usually almost identical, distinguished by only slight or even no variation. In such a case, it is unnecessary to store unchanging parts of an image, and only necessary to make slight modifications to previous images. In short, during video encoding/decoding, a subsequent frame may be reconstructed from a previous frame using information recorded during motion. As such, it is unnecessary to store all frames, thus effectively reducing an amount of transmitted information, and thereby achieving video compression. Motion estimation techniques aim to record certain information during image motion, e.g. a motion vector, so as to obtain subsequent image via motion compensation.
Block matching is one of the most common motion estimation methods, which divides an image frame into multiple non-overlapping blocks to identify the most similar parts between the blocks at different times, and to obtain a motion vector between the blocks. Generally, it is possible for multiple objects to be present in each block. In other words, at a particular time, a block may be positioned at an intersection between the multiple objects. Please refer to FIG. 1, which is a schematic diagram of different objects being present in a same block according to the prior art. As shown in FIG. 1, an image frame F is divided into n blocks. At a time T1, a block MBx (one of blocks MB1-MBn) only contains an object Obj_A, and at a time T2, the block MBx contains another object Obj_B apart from the object Obj_A. For the block MBx, a corresponding motion vector is often calculated employing a motion vector mv_A corresponding to the object Obj_A and a motion vector mv_B corresponding to the object Obj_B. In such a case, a resultant motion vector is often prone to errors, due to a mixed presence of different (or greatly varying) object motions within the same block. Therefore, an actual moving direction of the objects in the image cannot be correctly determined.